﻿@using  Syncfusion.Blazor.Inputs
@using Syncfusion.Blazor.Buttons
@using System
@using Syncfusion.Blazor
@using Syncfusion.Blazor.Data


@page "/grid/gird2"

 <SfTextBox  @bind-Value="@customerId"   Placeholder="Small"  Type="InputType.Text"  ></SfTextBox>
<SfButton Content="查询"  @onclick="Serach"> 
                            
                        </SfButton>
                        <SfButton @onclick="Add"> Add </SfButton>
                        <SfButton @onclick="Update"> Update - 1001 </SfButton>
<SfButton @onclick="Remove"> Delete the selected row </SfButton>
<SfButton @onclick="OnSelect" Content="获取"></SfButton>
                        
                        <SfGrid @ref="Grid" AllowResizing="true" ShowColumnChooser="true" Toolbar="@( new List<string>() { "ColumnChooser"})"  AllowReordering="true"  TValue="OrderData" AllowPaging="true" AllowSelection="true" Query="@QueryData">
                            
                             <GridEditSettings    ></GridEditSettings>
                            @* <GridEvents OnRecordClick="RecordClickHandler" TValue="OrderData"></GridEvents> *@

                            <SfDataManager AdaptorInstance="@typeof(CusotomAdaptor)" Adaptor="Adaptors.CustomAdaptor">
                                
                            </SfDataManager>
                            <GridSelectionSettings CheckboxOnly="true" PersistSelection="true"></GridSelectionSettings>
                            <GridPageSettings PageCount="5" PageSizes="true"></GridPageSettings>
                            <GridColumns>
                                <GridColumn Type="ColumnType.CheckBox" Width="50"></GridColumn>
                                <GridColumn Field=@nameof(OrderData.OrderID) HeaderText="OrderID" IsIdentity="true" IsPrimaryKey="true" TextAlign="TextAlign.Right" Width="120">
                                </GridColumn>
                                <GridColumn Field=@nameof(OrderData.CustomerID) HeaderText="CustomerName" Width="150"></GridColumn>
                                <GridColumn Field=@nameof(OrderData.OrderDate) Format="yyyy-MM-dd HH:mm:ss" HeaderText="OrderDate" Width="150"></GridColumn>
                                <GridColumn Field=@nameof(OrderData.Freight) HeaderText="Freight" Width="150"></GridColumn>
                                
                            </GridColumns>
                        </SfGrid>